<?php
	require_once( '../system/mdao/Class_M_OTHER.php' );
	require_once( '../system/smarty.inc' );
	require_once( '../system/ecjp_m.php' );
	$v = NULL;
	$para = "";
	if( isset($_GET['t']) && $_GET['t'] != '' ){
		$para =  $_GET['t'];
		if( isset($_GET['v']) && $_GET['v'] != '' ){
			$value = urldecode($_GET['v']);
		}
		
	}else{
		echo "検索エラー";
		exit;
	}
	
	$page = array();
	if( isset( $_GET['page'] ) && is_numeric( $_GET['page'] ) ){		
		$page['current'] = $_GET['page'];	
	}else{
		$page['current'] = 1;
	}

	switch ($para) {
		case "shop":
			$data = Class_M_OTHER::get_shop($value, $page);
			break;
			
		 default:
            $err = "パラメタ―エラー";
            echo $err;
            exit;
            break;
		
	}

	$smarty->assign('data',  $data);
	$smarty->assign('paraname', $para );
	$smarty->assign('nameval',$value );
	
	if( isset($page) )  $smarty->assign('page', $page);
	if ($page['cnt']>0) {
		$smarty->assign( 'pageing', $smarty->fetch('page_search.html') );
	} else {
		$smarty->assign( 'pageing', "情報は見つかりませんでした" );
	}
	
	
	$smarty->display('msearch_shop.html');
	
	
?>
